<?php

echo "Inhalt der Datei: kneipenAnzeigen3.inc.php";

include 'includes/db_connect.inc.php';

$sql_query = "SELECT * FROM kneipen";
$result = $db_con->query($sql_query);

if ($result === FALSE) {
    trigger_error('Wrong SQL: ' . $sql_query . ' Error: ' . $db_con->error, E_USER_ERROR);
} else {
    $rows_returned = $result->num_rows;
}
$result->data_seek(0);

echo "<table id=\"example1_table\" >";
echo "<thead>";
echo "<tr>
        <th><a class=\"bold\" href=\"javascript:$('#example1_table').sortTable({onCol: 1, keepRelationships: true})\">Name</a></th>
        <th><a class=\"bold\" href=\"javascript:$('#example1_table').sortTable({onCol: 2, keepRelationships: true})\">Art</a></th>
        <th><a class=\"bold\" href=\"javascript:$('#example1_table').sortTable({onCol: 3, keepRelationships: true, sortType: 'numeric'})\">Note</a></th>
        <th><a class=\"bold\" href=\"javascript:$('#example1_table').sortTable({onCol: 4, keepRelationships: true})\">Kommentar</a></th>
      </tr>";
echo "</thead>";
echo "<tbody>";
while ($row = $result->fetch_assoc()) {
    echo "<tr>";
    echo "<td>" . $row['Name'] . "</td>";
    echo "<td>" . $row['Art'] . "</td>";
    echo "<td>" . $row['Note'] . "</td>";
    echo "<td>" . $row['Kommentar'] . "</td>";
    echo "</tr>";
}
echo "</tbody>";
echo "</table>";
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
?>
